
<!--https://www.cnblogs.com/jin-zhe/p/9985436.html-->

<template>
  <section>
    <h1 ref="hello">{{ value }}</h1>
<!--    <el-button type="danger" @click="get">点击</el-button>-->
      <button type="button" @click="get">点击</button>
  </section>
</template>
<script>
export default {
  data() {
    return {
      value: 'Hello World ~'
    };
  },
  methods: {
    get() {
      this.value = '你好啊';
      console.log(this.$refs['hello'].innerText);
      this.$nextTick(() => {
        debugger
        console.log(this.$refs['hello'].innerText);
      });
    }
  },
  mounted() {
  },
  created() {
  }
}
</script>
